package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.HmzCollectionSourceMapper;
import com.ruoyi.system.domain.HmzCollectionSource;
import com.ruoyi.system.service.IHmzCollectionSourceService;

/**
 * 藏品来源Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-25
 */
@Service
public class HmzCollectionSourceServiceImpl implements IHmzCollectionSourceService 
{
    @Autowired
    private HmzCollectionSourceMapper hmzCollectionSourceMapper;

    /**
     * 查询藏品来源
     * 
     * @param id 藏品来源主键
     * @return 藏品来源
     */
    @Override
    public HmzCollectionSource selectHmzCollectionSourceById(Long id)
    {
        return hmzCollectionSourceMapper.selectHmzCollectionSourceById(id);
    }

    /**
     * 查询藏品来源列表
     * 
     * @param hmzCollectionSource 藏品来源
     * @return 藏品来源
     */
    @Override
    public List<HmzCollectionSource> selectHmzCollectionSourceList(HmzCollectionSource hmzCollectionSource)
    {
        return hmzCollectionSourceMapper.selectHmzCollectionSourceList(hmzCollectionSource);
    }

    /**
     * 新增藏品来源
     * 
     * @param hmzCollectionSource 藏品来源
     * @return 结果
     */
    @Override
    public int insertHmzCollectionSource(HmzCollectionSource hmzCollectionSource)
    {
        hmzCollectionSource.setCreateTime(DateUtils.getNowDate());
        return hmzCollectionSourceMapper.insertHmzCollectionSource(hmzCollectionSource);
    }

    /**
     * 修改藏品来源
     * 
     * @param hmzCollectionSource 藏品来源
     * @return 结果
     */
    @Override
    public int updateHmzCollectionSource(HmzCollectionSource hmzCollectionSource)
    {
        hmzCollectionSource.setUpdateTime(DateUtils.getNowDate());
        return hmzCollectionSourceMapper.updateHmzCollectionSource(hmzCollectionSource);
    }

    /**
     * 批量删除藏品来源
     * 
     * @param ids 需要删除的藏品来源主键
     * @return 结果
     */
    @Override
    public int deleteHmzCollectionSourceByIds(Long[] ids)
    {
        return hmzCollectionSourceMapper.deleteHmzCollectionSourceByIds(ids);
    }

    /**
     * 删除藏品来源信息
     * 
     * @param id 藏品来源主键
     * @return 结果
     */
    @Override
    public int deleteHmzCollectionSourceById(Long id)
    {
        return hmzCollectionSourceMapper.deleteHmzCollectionSourceById(id);
    }
}
